/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apt.servelet;

import com.apt.tag.Connect_DB;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Lambach
 */
public class Disable_User {

   

    public static boolean setDisable(String userId) {
         String up = " UPDATE [Matrimony].[dbo].[Accounts] SET[Account_Status] = 0 WHERE [Account_Id]=?";
        boolean re = false;
        Connection con = null;
        PreparedStatement ps=null;
        try {
            con = Connect_DB.getConnection();
            ps=con.prepareStatement(up);
            ps.setInt(1, new Integer(userId));
            int i=ps.executeUpdate();
            if(i>0){
                re=true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally{
            Connect_DB.close(null, null, ps, con);
        }
        return re;
    }
}
